﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Product.aspx.cs" Inherits="SanPham_Product" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Our Product</title>
    <link type="text/css" rel="stylesheet" href="Style.css" />
    <link rel="stylesheet" type="text/css" href="../index/Webshop.css" />
    <link rel="stylesheet" type="text/css" href="../index/menubar.css" />
</head>
<body>
    <form id="form1" runat="server">
        <div id="Group">
            
            <img alt="Group2" src="../picture/Group2.png" />
        </div>
        <div id="Login">
                        
            <asp:Button ID="BtnLogin" runat="server" Width="102px" cssclass="login" OnClick="BtnLogin_Click" Text="Log In" Height="34px" />
                            
            <asp:Button ID="BtnLogout" runat="server" CssClass="login" OnClick="BtnLogout_Click1" Text="Log Out" Visible="False" Width="103px" Height="34px" />
            
            <asp:Button ID="BtnOrder" runat="server"   Width="103px" Text="Order" CssClass="logout" Height="34px" Visible="False" OnClick="BtnOrder_Click" />
                            
            <asp:Button ID="btnRedirect" runat="server" OnClick="btnRedirect_Click" Visible="False" Width="103px" Text="Account" CssClass="logout" Height="34px" />
            
        </div>
       
        <!------------Menubar-------------------------->
        <div id="menubar">
            <ul class="menu">

                <li><a href="../index/index.aspx">Home</a></li>
                <li><a href="../Contact/About us.aspx">Avenger team</a></li>      
                <li><a href="../Product/Product.aspx">Our Product</a></li>
                <li><a href="../Contact/Contact us.aspx">Contact</a></li>
            </ul>
        </div>
        <!------------end menubar -------------------->


   <div id="all">
        <div id="head">
            <div id="user">
                <img src="user.png" />
            </div>
        </div>
        <!------------header------------------------->
        <div id="tab">

            <div id="but">
        <asp:Button ID="btnShopCart" runat="server" OnClick="Button1_Click" Text="Go to ShoppingCart" cssclass="btnViewU"/></div>
        <div id="gridview">
            <asp:GridView ID="tbProduct" runat="server" 
              AutoGenerateColumns="False" DataKeyNames="PID"
              DataSourceID="SqlDataSource1" AutoGenerateSelectButton="True" OnSelectedIndexChanging="tbProduct_SelectedIndexChanging">
    <Columns>
    <asp:BoundField DataField="PID" HeaderText="PID" 
                InsertVisible="False" ReadOnly="True"
                               SortExpression="PID" />
    <asp:BoundField DataField="Name" HeaderText="Name" 
                               SortExpression="Name" />
        <asp:BoundField DataField="Price" HeaderText="Price" 
                               SortExpression="Price" />
    <asp:TemplateField HeaderText="Image">
    <ItemTemplate>
    <asp:Image ID="Image1" runat="server" 
           ImageUrl='<%# "Handler.ashx?PID=" + Eval("PID")%>'/>
    </ItemTemplate>
    </asp:TemplateField>
        <asp:BoundField DataField="Stocked" HeaderText="Stocked" 
                               SortExpression="Stocked" />
        <asp:BoundField DataField="Description" HeaderText="Description" 
                               SortExpression="Description" />
    </Columns>
    </asp:GridView>
            </div>

            <br />

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>"
    SelectCommand="SELECT [PID], [Name], [Price],[Image], [Stocked], [Description] 
              FROM [_Product]"></asp:SqlDataSource>

              </div>
        </div>
    </form>
</body>
</html>
